<%@page language="java" pageEncoding="UTF-8"%>
<%@page import="java.util.HashSet"%>
<%@page import="java.util.Set"%>
<%@page import="com.shsh.safemanage.util.Util"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@page import="com.shsh.safemanage.model.Problem"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.ProblemDao"%>
<%@page import="com.shsh.safemanage.action.ActionCreator"%>
<%@page import="com.shsh.safemanage.action.BrowseProblemAction"%>

<%
{
session.removeAttribute(Constants.SESSION_ESCALATE_USER);

BrowseProblemAction browseAction = ActionCreator.createBrowseProblemAction();
ProblemDao problemDao = DaoCreator.createProblemDao();
User user = (User) session.getAttribute(Constants.SESSION_USER);
%>
<div class="hider" id="hider">
	<span>&nbsp;</span>
</div>
<div class="position">
	<img src="images/position2.jpg" style="padding: 7px 9px; float: left;" />当前位置：上海高桥分公司问题管理平台 &gt;&gt; 缺陷填报
</div>
<div class="tt">您所填报的通用问题</div>
<div class="content">
	<table align="center" border="1" width="99%" cellpadding="0"
		cellspacing="0">
		<%
		List<Problem> problemList = problemDao.getProblemsTobeDefect(user.getId());
		%>
		<tr style="font-weight: bold" align="center">
			<td class="td1" width="20%">作业部（业务中心）</td>
			<td class="td1" width="20%">装置</td>
			<td class="td1" width="20%">问题标题</td>
			<td class="td1" width="6%">发现人</td>
			<td class="td1" width="8%">填报日期</td>
			<td class="td1" width="8%">回复日期</td>
			<td class="td1" width="12%">操作</td>
		</tr>
		<%
		for (Problem problem : problemList) {
		%>
		<tr>
			<td><%=problem.getDepartment1Name()%></td>
			<td><%=problem.getEquipmentName()%></td>
			<td><%=problem.getProblemTitle()%></td>
			<td align="center"><%=problem.getWriteUserName()%></td>
			<td align="center"><%=Util.formatDate(problem.getWriteTime().getTime())%></td>
			<td>&nbsp;</td>
			<td align="center">
				<a href="javascript:" 
					onclick="openConvertDefect(<%=problem.getId() %>)"
					style="color: <%=(problem.getProcessStatus() == Constants.PROBLEM_STATUS_CLOSE)? "black":"red"%>">输出为缺陷报告</a></td>
		</tr>
		<%
		}
		%>
	</table>
</div>
<script type="text/javascript">
function openConvertDefect(problemID){
	loadPageSection(
	'<%=request.getContextPath()%>/defect/convert_defect.jsp', 
	'mainContentDiv', 
	{
		id: problemID
	}, 
	true
	);
};

</script>
<%
}
%>
